import { type RouteRecordRaw,createRouter,createWebHashHistory} from 'vue-router'
import { HomeOutline,SearchOutline,SettingsOutline,TimerOutline,EaselOutline } from '@vicons/ionicons5'

export const routes: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: '/home', // 进入系统重定向到首页
  },
  {
    path: '/home',
    meta: {
      menu: '视频',
      icon: HomeOutline,
    },
    children: [
      {
        name:"home",
        path: '/home',
        component: () => import('@/views/home/index.vue'),
        meta: {
          menu: '视频推荐',
        },
      },
      {
        name:"list",
        path: '/home/list',
        component: () => import('@/views/home/list.vue'),
        meta: {
          menu: '列表',
        },
      } ,
      {
        name:"detail",
        path: '/home/detail',
        component: () => import('@/views/home/detail.vue'),
        meta: {
          menu: '详情',
        },
      } ,
      {
        name:"small",
        path: '/home/small',
        component: () => import('@/views/home/small.vue'),
        meta: {
          menu: '小组件',
        },
      } 
    ]

  },
  {
    name:'search',
    path: '/search',
    component: () => import('@/views/search/index.vue'),
    meta: {
      menu: '资源库',
      icon: SearchOutline,
    },
  },
  {
    name:'Program',
    path: '/Program',
    component: () => import('@/views/Program/index.vue'),
    meta: {
      menu: '节目单',
      icon: EaselOutline,
    },
  },
  {
    name:'history',
    path: '/history',
    component: () => import('@/views/history/index.vue'),
    meta: {
      menu: '历史',
      icon: TimerOutline,
    },
  },
  
  {
    path: '/system',
    component: () => import('@/views/system/index.vue'),
    meta: {
      menu: '系统设置',
      icon: SettingsOutline,
    },
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router